<?php
$referer = parse_url(strtolower($_SERVER['HTTP_REFERER']), PHP_URL_HOST);
$ex = explode(".", $referer);
if($ex[count($ex) - 2] != "1haza" || $ex[count($ex) - 1] != "com"){
    if(!isset($_REQUEST['debug']) || $_REQUEST['debug'] != "6661haza"){
        exit;
    }
}
$type = $_REQUEST['type'];
$vid = $_REQUEST['vid'];
if(strstr($vid, "~")){
    //$vid = substr("");
}
$m3u8 = false;
if($type == "letv" || $type == "letvcloud" || $type == "mmsid" || $type == "vmgtv" || $type == "hunantv"){ $m3u8 = true; }
$tm = time();
$sign = md5("{$tm}~{$vid}~51bc4c807922e366ea4fb80f111e8d70");

if(strstr($vid, ".mp4") || $type == "file"){
	$directVideo = $vid;
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>player</title>
<style type="text/css">body,html,div{background-color:#000;padding: 0;margin: 0;width:100%;height:100%;color:#aaa;}</style>
<script type="text/javascript">
    var definition = "1";
    var qrcode = "";
    var prompttext = "1";
	var playm3u8_logo = "null";
	var pm_logo = "2,0,-200,25";
</script>
</head>
<body>
<div id="player"></div>
<script type="text/javascript" src="/ckplayer/ckplayer.js"></script>
<script type="text/javascript">
<?php if(preg_match("/iPad|iPhone|Android|Linux|iPod/", $_SERVER['HTTP_USER_AGENT']) && !$directVideo){ ?>
	$.getScript('/api/parse.php?h5url=null&type=<?php echo $type ?>&vid=<?php echo $vid ?>&tm=<?php echo $tm ?>&sign=<?php echo $sign ?>&script=1&userlink=<?php echo $userlink ?>');
<?php } else { ?>
    var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always'};
<?php if($directVideo) { ?>
    var video=['<?php echo $directVideo ?>'];
    var flashvars={f:'<?php echo $directVideo ?>',s:'0',c:'0',p:'1',h:'1',
<?php } else { ?>
    var video=['/api/parse.php?h5url=null&type=<?php echo $type ?>&vid=<?php echo $vid ?>&tm=<?php echo $tm ?>&sign=<?php echo $sign ?>&ajax=1&userlink=<?php echo urlencode($_SERVER['HTTP_REFERER']) ?>->ajax/get/utf-8'];
    var flashvars={f:'/api/parse.php?xmlurl=null&type=<?php echo $type ?>&vid=<?php echo $vid ?>&tm=<?php echo $tm ?>&sign=<?php echo $sign ?>&userlink=<?php echo urlencode($_SERVER['HTTP_REFERER']) ?><?php echo $m3u8 ? "&m3u8=1" : ""; ?>',s:'2',c:'0',p:'1',h:'1',
<?php } ?>
		m: "",
		d: "/play/extend/picture/1116.jpg",
		u: "https://shop128861213.taobao.com",
		l: "/play/extend/picture/1116.jpg",
		r: "https://shop128861213.taobao.com",
		t: "3",
	};
    CKobject.embed('/ckplayer/ckplayer.swf','player','ckplayer_a1','100%','100%',false,flashvars,video,params);
<?php } ?>
</script>
</body>
</html>